package org.example.function;

import org.apache.flink.api.common.functions.MapFunction;
import org.example.flink.pojo.WaterSensor;

/**
 * @Author: tang
 * @Description:
 * @Date 2025/2/19 11:08
 */
public class WaterSensorFunction implements MapFunction<String, WaterSensor> {
    @Override
    public WaterSensor map(String value) throws Exception {
        String[] splitArr = value.split(",");
        return new WaterSensor(splitArr[0],splitArr[1],Integer.parseInt(splitArr[2]));
    }
}
